package com.bonc.situation.job;
import org.slf4j.Logger;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.quartz.QuartzJobBean;

import com.bonc.situation.service.DataCollectionService;
/**
 * 
 * @author guxf
 *
 */
public class DataSyncJob extends QuartzJobBean {
	private final static Logger logger = LoggerFactory.getLogger(DataSyncJob.class);
	@Autowired
	private DataCollectionService service;
	@Override
	protected void executeInternal(JobExecutionContext arg0)
			throws JobExecutionException {
		logger.info("Start数据同步任务！");
		try {
			service.syncData();
		} catch (Exception e) {
			logger.error("获取城市信息异常",e);
			throw new RuntimeException("获取城市信息异常："+e);
		}
		logger.info("End 数据同步任务");
	}

}
